<template >
    <div class="student">
        <h1 >学生姓名:{{name}}</h1>
        <h1 >学生性别:{{sex}}</h1>
        <button @click="sendStudentName" >把student数据发给school</button>

    </div>
</template>

<script>
export default {
    name:'Student',
    data() {
        return {
            name:'JJ1',
            sex: '男'
        }
    },methods:{
        sendStudentName(){
            this.$bus.$emit('hello',this.name)
        }
    }
}
</script>

<style scoped lang="less">
.student{
    background-color: rgb(45, 37, 23);
    padding: 5px;
    margin-top: 30px;
}
</style>
